Skip to content

Conversation

Gelbpunkt
Copy link

What does this PR do

The type of the ptrace request parameter is architecture-independent in libc and only c_uint for uclibc and glibc on Linux. This fixes compilation against non-glibc s390x targets like s390x-unknown-linux-musl.

Ref:

~/libc $ rg "ptrace\(request"
src/unix/bsd/netbsdlike/openbsd/mod.rs
2009:    pub fn ptrace(request: c_int, pid: crate::pid_t, addr: caddr_t, data: c_int) -> c_int;

src/unix/bsd/freebsdlike/mod.rs
1682:    pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_char, data: c_int) -> c_int;

src/unix/bsd/netbsdlike/netbsd/mod.rs
2584:    pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_void, data: c_int) -> c_int;

src/unix/bsd/apple/mod.rs
5428:    pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_char, data: c_int) -> c_int;

src/unix/linux_like/android/mod.rs
3633:    pub fn ptrace(request: c_int, ...) -> c_long;

src/unix/linux_like/linux/uclibc/mod.rs
443:    pub fn ptrace(request: c_uint, ...) -> c_long;

src/unix/linux_like/linux/musl/mod.rs
872:    pub fn ptrace(request: c_int, ...) -> c_long;

src/unix/linux_like/linux/gnu/mod.rs
1201:    pub fn ptrace(request: c_uint, ...) -> c_long;

Checklist:

  • I have read CONTRIBUTING.md
  • I have written necessary tests and rustdoc comments
  • A change log has been added if this PR modifies nix's API

The type of the ptrace request parameter is architecture-independent
in libc and only c_uint for uclibc and glibc on Linux

Signed-off-by: Jens Reidel <[email protected]>
Copy link
Member

@asomers asomers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but it needs a changelog message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants